<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     
    <div id="app">
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>
         {{reverseMsg}}<br/>

    </div>
    <script src='https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js'></script>
    <script>
        //computed 计算属性
        //只学习computed的get用法
        //计算熟悉的函数名可以和data一样是使用
        //函数必须要返回
        

        //计算属性的特点
        //1、根据外界响应式依赖值变化而变化
        //2、结果会缓存
        const vm = new Vue({
            el:"#app",
            data:{
                msg:"dog才倒着读"
            },
            methods:{},
            computed: {
                reverseMsg(){
                    console.log("我执行了")
                   return this.msg.split("").reverse().join("");
                }
            }
        })
    </script>
</body>
</html>